<?php

/**
 * Payment form.
 *
 * @package    ##PROJECT_NAME##
 * @subpackage form
 * @author     ##AUTHOR_NAME##
 * @version    SVN: $Id: sfPropelFormTemplate.php 10377 2008-07-21 07:10:32Z dwhittle $
 */
class partnerPaymentForm extends BasePaymentForm
{
  public function configure()
  {
  	
  	    unset(
      $this['created_at'],
      $this['desc'],
      $this['date_expire']
    );
  	
    
        $this->setWidgets(array(
      'id'          => new sfWidgetFormInputHidden(),
      'payment_id'  => new sfWidgetFormInputHidden( array (), array ('value' => '2' )),
      'level_id'    => new sfWidgetFormInputHidden(array (), array ('value' => '15' )),
      'direction'   => new sfWidgetFormInputHidden( array (), array ('value' => '1')),
      'summa'       => new sfWidgetFormInput(),
    ));

    		 if(sfContext::getInstance()->getRequest()->getParameter('partner_id'))
		 {

		      $this->widgetSchema['user_id'] =  new sfWidgetFormInputHidden( array (), array ('value' => sfContext::getInstance()->getRequest()->getParameter('partner_id') ));
  	            
		 }
                 else
                 {
                      $c = new Criteria();
                      $c->add(sfGuardUserPeer::IS_PARTNER,true);
                      $this->widgetSchema['user_id'] =  new sfWidgetFormPropelChoice(array('model' => 'sfGuardUser','criteria'=>$c, 'add_empty' => false));
                 }
  	
    $this->widgetSchema->setNameFormat('payment[%s]');
    
  }
}
